package com.pai4j.common.enums.community.aigc;
import com.pai4j.common.exception.NotFoundException;
import com.pai4j.common.util.MD5Utils;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 *
 *
 * @author: CYM-pai
 * @date: 2025/10/27 16:26
 **/
@Getter
@AllArgsConstructor
public enum AiPhotoAPIEnum {

    MHF("6fc9e574b4451416433b6308112337da","https://api.aigcaas.cn/v3/application/image_style_dctnet/action/default", "卡通风格API"),
    HAND_DRAWN("e798a2048e902887cf748175d9ffc64c","https://api.aigcaas.cn/v3/application/image_style_dctnet/action/handdrawn", "手绘风格API"),
    DESIGN_COMPOUND("a1770840dfc0fdb93684fe56ec6c5715","https://api.aigcaas.cn/v3/application/image_style_dctnet/action/design", "插画风格API"),
    ART("b0872afda8a25c7a691ab823e98e1eda","https://api.aigcaas.cn/v3/application/image_style_dctnet/action/artstyle", "艺术风格API"),
    SKETCH("8d2ec0d20133c1861e32fe36e60d57a3","https://api.aigcaas.cn/v3/application/image_style_dctnet/action/sketch", "素描风格API"),
    COMPOUND("2bbae7cf9df2f4a6ffdfdf69c24ed5ee","https://api.aigcaas.cn/v3/application/image_style_dctnet/action/illustration", "通用风格API"),
    THREE_D("6b0c98496a95d18b1a1e5a27d189af75","https://api.aigcaas.cn/v3/application/image_style_dctnet/action/3d", "3d API");

    private String id;

    private String api;

    private String desc;


    public static void main(String[] args) {
        for (AiPhotoAPIEnum s : AiPhotoAPIEnum.values()) {
            System.out.println(MD5Utils.md5(s.getApi()));
        }
    }

    public static AiPhotoAPIEnum getModelApiById(String id) {
        if (StringUtils.isBlank(id)) {
            throw new NotFoundException("不支持的模型");
        }
        for (AiPhotoAPIEnum model : AiPhotoAPIEnum.values()) {
            if (model.getId().equals(id)) {
                return model;
            }
        }
        throw new NotFoundException("不支持的模型");
    }
}
